#!/bin/bash

ROOT=`pwd`

# download sysroot
if [ ! -d $ROOT/sysroot ]; then
    git clone --branch OpenHarmony-v2.2-Beta git@gitee.com:openharmony/prebuilts_lite_sysroot.git $ROOT/sysroot
else
    echo "$ROOT/sysroot -- already existed !!"
fi

# download llvm(clang/clang++)
if [ ! -d $ROOT/llvm ]; then
    wget https://repo.huaweicloud.com/harmonyos/compiler/clang/10.0.1-62608/linux/llvm.tar.gz -O $ROOT/llvm.tar.gz
    tar -xzf $ROOT/llvm.tar.gz -C $ROOT/
    rm -rf $ROOT/llvm.tar.gz
else
    echo "$ROOT/llvm -- already existed !!"
fi
